package com.vizhuo.push.umeng.base;

import java.io.Serializable;

/**
 * @author YuanWenLong 作者 E-mail: yuanwenlong2010@163.com
 * @date 创建时间：2015年6月15日 下午3:41:53
 * @version 1.0
 * @parameter
 * @since
 * @return
 */
public class PushResult implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 3206031414477772161L;

    private int httpResult;

    private String ret;

    private PushResultData data;

    private String returnJSON;

    private String requestJSON;

    private String sysError;

    public boolean isPushSuccess() {
        if (httpResult == 200 && ret.equals(PushConstant.RET_SUCCESS)) {
            return true;
        } else {
            return false;
        }
    }

    public String getErrorMessage() {
        if (ret.equals(PushConstant.RET_FAIL)) {
            return data.getError_code();
        } else if (ret.equals(PushConstant.RET_SYSTEM_FAIL)) {
            return sysError;
        } else {
            return null;
        }
    }

    public PushResult() {
        super();
    }

    public String getSysError() {
        return sysError;
    }

    public void setSysError(String sysError) {
        this.sysError = sysError;
    }

    public int getHttpResult() {
        return httpResult;
    }

    public void setHttpResult(int httpResult) {
        this.httpResult = httpResult;
    }

    public String getRet() {
        return ret;
    }

    public void setRet(String ret) {
        this.ret = ret;
    }

    public PushResultData getData() {
        return data;
    }

    public void setData(PushResultData data) {
        this.data = data;
    }

    public String getReturnJSON() {
        return returnJSON;
    }

    public void setReturnJSON(String returnJSON) {
        this.returnJSON = returnJSON;
    }

    public String getRequestJSON() {
        return requestJSON;
    }

    public void setRequestJSON(String requestJSON) {
        this.requestJSON = requestJSON;
    }

}
